import axios from 'axios';

// 列表分页
export const getEventcrossrulePage = (data) =>
  axios.request({
    url: '/api/v1/event/cross/rule/page',
    method: 'get',
    params: data
  });

// 失效
export const invalid = (crossRuleId) =>
  axios.request({
    url: `/api/v1/event/cross/rule/${crossRuleId}/state/sx`,
    method: 'get'
  });
// 生效
export const takeEffect = (crossRuleId) =>
  axios.request({
    url: `/api/v1/event/cross/rule/${crossRuleId}/state/yx`,
    method: 'get'
  });
// 根据区划码 获取显示信息 以,分割传参
export const getAreas = (areaCodes) =>
  axios.request({
    url: '/api/v1/event/areas/areas?areaCodes=' + areaCodes,
    method: 'get'
  });
// 级联选择地区 传任意一个参数为null 获取根列表
export const getAreasTree = (params) =>
  axios.request({
    url: '/api/v1/event/areas/tree',
    method: 'get',
    params
  });
// 处理项选择树
export const getImplementationTree = () =>
  axios.request({
    url: '/api/v1/event/implementation/event/tree',
    method: 'get'
  });
// 新增接口
export const batchEventcrossrule = (data) =>
  axios.request({
    url: '/api/v1/event/cross/rule/batch',
    method: 'post',
    data
  });
// 新增接口
export const addEventcrossrule = (data) =>
  axios.request({
    url: '/api/v1/event/cross/rule',
    method: 'post',
    data
  });
// 编辑接口
export const editEventcrossrule = (data) =>
  axios.request({
    url: '/api/v1/event/cross/rule',
    method: 'put',
    data
  });
// 详情接口
export const getEventcrossrule = (crossRuleId) =>
  axios.request({
    url: `/api/v1/event/cross/rule/${crossRuleId}`,
    method: 'get'
  });
